
import java.util.ArrayList;
import processing.core.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author admindev
 */
public class Spatioport extends Player
{
    private int x = 800;
    private int y = 400;
    private int height = 125;
    private int width = 125;
    
    private PImage image;
    private String nameImage = "spatioport_terran.png";

    private int xCase1 = 290;
    private int yCase1 = 605;
    private int heightCase1 = 70;
    private int widthCase1 = 70;
    private PImage logoCase1;
    private String PngCase1 = "ImageHub/cuirasse_terran.png";
    
    private int xCase2 = 400;
    private int yCase2 = 605;
    private int heightCase2 = 70;
    private int widthCase2 = 70;
    private PImage logoCase2;
    private String PngCase2 = "ImageHub/cuirasse_terran_up.png";
    
    private ArrayList tabProcessBar = new ArrayList();

    public Spatioport(Jeu program)
    {
        super(program);
    }

    public void display()
    {
        program.image(getImage(),x ,y ,height ,width );
    }
    
    public void process(float mouseX, float mouseY)
    {
        if(onCase1(mouseX ,mouseY))
        {
            
        }
        else if (onCase2(mouseX ,mouseY))
        {
            
        }
        else if (onCase3(mouseX ,mouseY))
        {
            
        }
        else if (onCase4(mouseX ,mouseY))
        {
            
        }else{
            
        }
    }
    
    public boolean onPosition(float mouseX ,float mouseY)
    {
        if( mouseX > x && mouseX < x+width && mouseY > y && mouseY < y+height )
            return true;
        else
            return false;
    }
    
    public boolean onCase1(float mouseX ,float mouseY)
    {
        if( mouseX > xCase1 && mouseX < xCase1+widthCase1 && mouseY > yCase1 && mouseY < yCase1+heightCase1 )
            return true;
        else
            return false;
    }
    
    public boolean onCase2(float mouseX ,float mouseY)
    {
        if( mouseX > xCase2 && mouseX < xCase2+widthCase2 && mouseY > yCase2 && mouseY < yCase2+heightCase2 )
            return true;
        else
            return false;
    }
    
    public boolean onCase3(float mouseX ,float mouseY)
    {
        if( mouseX > x && mouseX < x+width && mouseY > y && mouseY < y+height )
            return true;
        else
            return false;
    }
    
    public boolean onCase4(float mouseX ,float mouseY)
    {
        if( mouseX > x && mouseX < x+width && mouseY > y && mouseY < y+height )
            return true;
        else
            return false;
    }
    
    public void displayProcessBar()
    {
        logoCase1 = program.loadImage(PngCase1);
        program.image(logoCase1, xCase1, yCase1,heightCase1,widthCase1);
        logoCase2 = program.loadImage(PngCase2);
        program.image(logoCase2, xCase2, yCase2,heightCase2,widthCase2);
        //program.image(logoCase3, xCase3, yCase3,heightCase3,widthCase3);
        //program.image(logoCase4, xCase4, yCase4,heightCase4,widthCase4);
    }
    
    
    ////////////////////////////////////////////////////////////////////////
    ////////                     Getter/ Setter                     ////////
    ///////////////////////////////////////////////////////////////////////
    
    public PImage getImage()
    {
        if(image == null)
        {
            image = program.loadImage(nameImage);
        }
        return image;
    }
    
    public int getX()
    {
        return x;
    }

    public void setX(int x)
    {
        this.x = x;
    }

    public int getY()
    {
        return y;
    }

    public void setY(int y)
    {
        this.y = y;
    }

    public int getHeight()
    {
        return height;
    }

    public void setHeight(int height)
    {
        this.height = height;
    }

    public int getWidth()
    {
        return width;
    }

    public void setWidth(int width)
    {
        this.width = width;
    }
    
    public String getNameImage()
    {
        return nameImage;
    }
}
